package com.clusterswisdom.horn.api.tmall.action.trade;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.fastjson.JSONObject;
import com.clusterswisdom.horn.api.ioc.HornAction;
import com.clusterswisdom.horn.api.ioc.HornResponse;
import com.clusterswisdom.horn.api.ioc.api.ApiConfig;
import com.clusterswisdom.horn.api.push.PushDataUtil;
import com.clusterswisdom.horn.api.tmall.action.AbstractTmallAction;

public class PushFinishTradeIdAction extends AbstractTmallAction implements HornAction{
	private Logger log = LoggerFactory.getLogger(PushFinishTradeIdAction.class);
	
	@Override
	public HornResponse execute(ApiConfig config, JSONObject param)
			throws Exception {
		
		log.debug("param :" + param.toString());
		//订单全链路中订单完成（签收）则推送订单号到ebiz
		if("T_TRADE_FINISHED".equals(param.getString("status"))){
			
			PushDataUtil.getUtil().pushData("${pushServer}/tmall/entityProduct/receivingGoods.action", param.getLong("tid"));
		}
		return null;
	}
}
